import os


command = '%s -i "%s"'
+ ' -f mp4 -r 30 -vcodec mpeg4 -maxrate 1000 -b 700 -qmin 3 -qmax 5 -bufsize 4096 -g 300 -acodec aac -ar 44100 -ab 192 -s 320x240 -aspect 4:3' 
+ '%s'

ffmpeg = 'ffmpeg'
input_filename = None
output_filename = None

os.system(command % (ffmpeg, input_filename, output_filename))

